package com.foreverwin.jzymes.report.rate.controller;

import com.foreverwin.jzymes.common.util.CommonMethods;
import com.foreverwin.jzymes.framework.base.AjaxResult;
import com.foreverwin.jzymes.framework.exception.BusinessException;
import com.foreverwin.jzymes.report.rate.service.FQCrateReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report/FQCrate")
public class FQCrateReportController {
    @Autowired
    FQCrateReportService fqCrateReportService;

    /**FQC批退率报表查询*/
    @RequestMapping("/FQCrateReport")
    public AjaxResult FQCrateReport(@RequestParam Map<String,Object> jsonMap ){
        try{
            jsonMap.put("site",CommonMethods.getSite());
            Map<String , Object> returnMap =  fqCrateReportService.FQCrateReport( jsonMap );

            return AjaxResult.returnSuccess().put("value" , returnMap);
        }catch ( BusinessException e ){
            return AjaxResult.returnError( e.getMessage() );
        }
    }
}
